import { Module } from '@nestjs/common'
import { AppController } from './app.controller'
import { AppService } from './app.service'
import { DevService } from './dev.service'
import dotenv from 'dotenv'
import path from 'path'

dotenv.config({ path: path.join(__dirname, '../.env') })
// console.log(process.env.NODE_ENV)

const KanoService = {
  provide: 'KanoService',
  useClass: process.env.NODE_ENV == 'development' ? DevService : AppService,
}
@Module({
  imports: [],
  controllers: [AppController],
  providers: [KanoService],
})
export class AppModule {}
